package graph.drawingshapes
{
	import flash.display.Graphics;
	
	import mx.events.PropertyChangeEvent;
	import mx.events.PropertyChangeEventKind;
	
	public class SolidFill extends BaseFill
	{
		public static const DefaultFillColor:uint = 0x000000;
		[Bindable]
		private var _fillColor:uint = DefaultFillColor;
		[Bindable]
		public function get fillColor():uint
		{
			return this._fillColor;
		}
		public function set fillColor(value:uint):void
		{
			if (value != this.fillColor)
			{
				var event:PropertyChangeEvent = PropertyChangeEvent.createUpdateEvent(this,"fillColor",this._fillColor,value);
				dispatchEvent(event);
				this._fillColor = value;				
			}
		}
		
		public static const DefaultFillAlpha:Number = 1.0;
		[Bindable]
		private var _fillAlpha:Number = DefaultFillAlpha;
		[Bindable]
		public function get fillAlpha():Number
		{
			return this._fillAlpha;
		}
		public function set fillAlpha(value:Number):void
		{
			if (value != this.fillAlpha)
			{
				var event:PropertyChangeEvent = PropertyChangeEvent.createUpdateEvent(this,"fillAlpha",this._fillAlpha,value);
				dispatchEvent(event);
				this._fillAlpha = value;
			}
		}
		
		public function SolidFill(fillColor:uint=DefaultFillColor, fillAlpha:Number=DefaultFillAlpha)
		{
			super();
			this.fillColor = fillColor;
			this.fillAlpha = fillAlpha;
		}
		
		public override function beginFill(graphics:Graphics):Graphics
		{
			graphics.beginFill(this.fillColor,this.fillAlpha);
			return graphics;
		}
	}
}